//
//  UnloadingAndHangBoxChooseCell.m
//  CJRailTransport
//
//  Created by Hank on 2018/2/1.
//  Copyright © 2018年 amplity. All rights reserved.
//

#import "UnloadingAndHangBoxChooseCell.h"

@implementation UnloadingAndHangBoxChooseCell

// 设置数据
- (void)setData:(NSMutableArray *)dataArray selectData:(NSMutableArray *)selectDataArray
{
    // 查询数组中是否保存集装箱编号
    BOOL isbool = [selectDataArray containsObject:dataArray[self.indexPath.row]];
    
    if (isbool) {
        // 选中状态
        self.checkImage.image = [UIImage imageNamed:@"select_button"];
    }else{
        // 未选中状态
        self.checkImage.image = [UIImage imageNamed:@"noSelect_button"];
    }
    // 保存集装箱数组
    _allContainerDataArray = dataArray;
    _containerDataArray = selectDataArray;
    // 集装箱编号
    _containerNo.text = dataArray[self.indexPath.row];
}

// 去除分割线
- (UIView *)lineView
{
    return [[UIView alloc]init];
}

#pragma mark - Action
// 复选框 Action
- (IBAction)checkBtnAction:(UIButton *)sender
{
    // 查询数组中是否保存集装箱编号
    BOOL isbool = [_containerDataArray containsObject:_allContainerDataArray[self.indexPath.row]];
    // 复选框点击 Block
    _checkImageClickBlock(self.indexPath, _allContainerDataArray[self.indexPath.row], !isbool);
}

@end
